package pers.xx.sbm.base;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

/**
 * @author zyfine
 * @ClassName: Constants
 * @Description: (静态常量)
 * @date 2017年4月6日 上午9:33:07
 */
public class Constants2 {


    public static StringBuffer EXCEL_CSS = new StringBuffer();

    static {
        //导入样式文件
        try {
            File cssFile = new File(PEConstant.class.getResource("../../../../").getFile().toString() + "static/css/report/download.css");
            if (cssFile.isFile() && cssFile.exists()) { //判断文件是否存在
                InputStreamReader read = new InputStreamReader(new FileInputStream(cssFile));//考虑到编码格式
                BufferedReader bufferedReader = new BufferedReader(read);
                String lineTxt = null;
                while ((lineTxt = bufferedReader.readLine()) != null) {
                    EXCEL_CSS.append(lineTxt);
                }
                read.close();
            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        EXCEL_CSS.append(".j2{text-indent: 2em;line-height: 150%;font-family:'宋体'; font-size: 12pt;} "
                + ".title{font-family:'黑体'; font-size: 22pt;font-weight: bold;}"
                + "h1{font-family:'黑体'; font-size: 16pt;}"
                + "h2{font-family:'黑体'; font-size: 15pt;}"
                + "h3{font-family:'黑体'; font-size: 14pt;}"
                + "h4{font-family:'宋体'; font-size: 12pt;}"
                + "h5{font-family:'宋体'; font-size: 12pt;}"
                + "table { text-align: center;font-family:'宋体';}");
    }


}